{extend name="public/home"/}
{block name="css"}
    <link rel="stylesheet" href="/static/css/genxin.css">
    <link rel="stylesheet" href="/static/css/gaishu.css">
  
{/block}
{block name="content"}

  <h1>个人资料</h1>
        <div class="bd">
            <form action="">
                <div class="form-con">
                    <h3>账户基本信息</h3>
                    <div>
                        <label>账户类型：</label>
                        <input type="text" value="{$record.catid}" name='catid' disabled>
                    </div>
                    <div>
                        <label>杠杆比例：</label>
                        <input type="text" value="{$record.lever}" name='lever' disabled>
                    </div>
                    <div>
                        <label>交易账号：</label>
                        <input type="text" value='{$record.username}' name='username'>
                    </div>
                    <div>
                        <label>您的姓名：</label>
                        <input type="text" value='{$record.contact}' name='contact'>
                    </div>
                    <div>
                        <label>手机：</label>
                        <input type="text" value='{$record.phone}' name='phone'>
                    </div>
                    <div>
                        <label>电子邮箱：</label>
                        <input type="text" value='{$record.email}' name='email'>
                    </div>
                    <div>
                        <label>国籍：</label>
                        <input type="text" value='{$record.country}' name='country'>
                    </div>
                    <div>
                        <label>证件号：</label>
                        <input type="text" value='{$record.card}' name='card'>
                    </div>
                    <div>
                        <label>省份：</label>
                        <input type="text" value='{$record.province}' name='province'>
                    </div>
                    <div>
                        <label>城市：</label>
                        <input type="text" value='{$record.city}' name='city'>
                    </div>
                    <div>
                        <label>地址：</label>
                        <input type="text" value='{$record.address}' name='address'>
                    </div>
                </div>
                <div class="form-con">
                    <h3>银行卡信息</h3>
                    <div>
                        <label>开户行：</label>
                        <input type="text" value='{$record.bankname}' name='bankname'>
                    </div>
                    <div>
                        <label>分行：</label>
                        <input type="text" value='{$record.banksub}' name='banksub'>
                    </div>
                    <div>
                        <label>银行代码：</label>
                        <input type="text" value='{$record.bankcode}' name='bankcode'>
                    </div>
                    <div>
                        <label>地址：</label>
                        <input type="text" value='{$record.bankaddress}' name='bankaddress'>
                    </div>
                    <div>
                        <label>户名：</label>
                        <input type="text" value='{$record.bankname}' name='bankname'>
                    </div>
                    <div>
                        <label>账号：</label>
                        <input type="text" value='{$record.bankcard}' name='bankcard'>
                    </div>
                </div>

                <input type="button" value="保存我的资料" class='save'>
            </form>
        </div>


{/block}
{block name="script"}
<script>

    $(function(){
      console.log(window.location.href);
      if(window.location.href == 'http://localhost:8086/IngeCMS/public/index.php/front/personal/index.html') {
        $('.nav a[href = "/IngeCMS/public/index.php/front/personal/index.html"]').parent().parent().css('display','block');
        $('.nav a[href = "/IngeCMS/public/index.php/front/personal/index.html"]').addClass('red');
      }

      $('.save').on('click', function(){
        var data = $('form').serialize()
        $.ajax({
          url:'{:url("edit",["id"=>$record["id"]])}',
          data:data,
          dataType:'json',
          type:'post',
          success:function(info){
            if(info.code == 0) {
              alert('修改成功');
              window.location.reload();
            };
            if(info.code == 1) {
              alert(info.msg);
              window.location.reload();
            }
          }
        })
      })      
    })

</script>
{/block}



